{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "76263344",
   "metadata": {},
   "source": [
    "# 字符串用法"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "b8dabef7",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'a-b-c'"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "str = \"-\";\n",
    "seq = (\"a\", \"b\", \"c\"); # 字符串序列\n",
    "str.join( seq )"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "c72b54ce",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['a', 'b', 'c']"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "['-'.join(s) for s in seq]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "6c7be7dc",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
